{% extends "topic_base.html" %}

{% from "object_reference/nav.html" import topic_name, topic_url, subpages with context %}

{% block javascript %}
{{ super() }}

// Add autogrowing to all inputs
$('input').autoGrowInput();

$(document).ready(function() {
   // apply handler
   $("#ajax_form").submit(function(e){
      // stop normal link click
      e.preventDefault();
     
      do_ajax_request( $("#ajax_request").val(), $("#ajax_result") );
   });
   
   // Set url in textbox of first user
   $("#ajax_request").val( $("a.known_username").attr("href") ).trigger("update");
   
   $("a.known_username").click(function(e){
     e.preventDefault();
     $("#ajax_request").val( $(this).attr("href") ).trigger("update");
     $("#ajax_form").trigger("submit");
   });
});

{% endblock javascript %}
